<%@ include file="init.jsp"%>


<ts:pageTemplate>
	<div class="container">
		<div>
			<div class="row-fluid">
				<span class="span6">

					<form method="post" id="assignUser"
						action="/FaTestingSystem/assignTestToUser">
						<table class="table table-hover table-bordered">
							<thead>
								<tr>
									<th>#</th>
									<th>Select</th>
									<th>Username</th>
									<th>User role</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="user" items="${users}" varStatus="status">
									<tr id="${user.username}">
										<td class="row">${status.index+1}</td>
										<td class="row"><input type="checkbox"
											value="${user.username}" name="assignUser"></td>
										<td class="row"><a>${user.username}</a></td>
										<td class="row">${user.group}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<button class="btn btn-warning pull-right" type="submit">Assign</button>
					</form>
				</span> <span class="span6">
					<table class="table table-hover table-bordered">
						<thead>
							<tr>
								<th>#</th>
								<th>Select</th>
								<th>Test Title</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="test" items="${tests}" varStatus="status">
								<tr id="${test.id}">
									<td class="row">${status.index+1}</td>
									<td class="row"><input type="checkbox" value="${test.id}"
										class="assignTest"></td>
									<td class="row"><a>${test.title}</a></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</span>
			</div>
		</div>
	</div>

	<script type="text/javascript"
		src="/FaTestingSystem/resources/js/logic/assign.js"></script>

</ts:pageTemplate>
